Skip to content

Docs/Test: colour schemes from Python via the ColorScheme constructor (#309) - #315

Merged
b-re-w merged 3 commits into
developfrom
feat/binder-colorscheme-docs
Oct 25, 2026
Merged

b-re-w merged 3 commits into
developfrom
feat/binder-colorscheme-docs

Conversation

@b-re-w

@b-re-w b-re-w commented Oct 25, 2026

Copy link
Copy Markdown
Member

Closes #309

Decision (c), leader-approved:

  • lightColorScheme, darkColorScheme and ColorScheme.copy have 48 defaulted parameters. That is past the omission cap of 6 (presence-branching is 2^n), so they bind with every parameter required.
  • Rejected: calling with defaults and then copy(). The defaults depend on other parameters (surfaceTint = primary), so the result would silently differ from Kotlin.
  • Python-side keyword factories (light_color_scheme) are pythonx-compose's.

Tests (ComposableRenderTest):

  • aColorSchemeBuiltByItsConstructorPaintsThePrimaryItWasGiven: ColorScheme(all 48) from Python, passed to MaterialTheme(colorScheme=...), paints the Button container red or green as given.
  • colorSchemeCopyIsBoundWithEveryParameterRequired: copy(primary=...) alone raises TypeError 'no value for', and copy(all 48) paints the new primary.

Results: compose fixture full run, see the checks below. SPEC B-3 is updated. No library or plugin code changes.

…is bound all-required (#309)

lightColorScheme / darkColorScheme / ColorScheme.copy have 48 defaulted parameters, past the omission
cap, so they bind with every parameter required (a defaults-then-copy strategy was rejected: defaults
depend on other parameters, surfaceTint = primary). From Python, ColorScheme(48 args) works and paints
its primary through MaterialTheme; copy(primary=...) alone raises 'no value for', copy(all 48)
works. SPEC B-3 records it; a keyword factory is pythonx-compose's.
@b-re-w
b-re-w merged commit 8ed68d9 into develop Oct 25, 2026
@b-re-w
b-re-w deleted the feat/binder-colorscheme-docs branch October 25, 2026 10:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant